// dlg.txt

//MK Edit
//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 47;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "You enter one of Haven's many claims in the Rokaj. This is a mine, here to provide your forts with a reliable source of quicksilver. It is icy cold, and a few of your soldiers and workers are gathered, shivering, in this entry hall.";
	text2 = "They are not well. They are pale and inert. They shudder constantly, even when they're close to the fire. They are afflicted not just with cold, but with terror.";
	text3 = "It's shocking to see. The warriors of Haven are the most resolute in the Known World. To see them cowering like this, in a vassal state of all places, would totally horrify your mother.";
	code =
		sf(this_town,1,1);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "To the west, you see three of your soldiers. There is one Havenite, leading two local guides. They wander in circles in the cave. Perhaps they are scouts.";
	text2 = "Then one turns, and you see his eyes. They are dead. Utterly without thought. Something has happened to these warriors. They hold their weapons drawn, hanging from limp hands.";
	code =
		sf(this_town,2,1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0;
	text1 = "You enter a huge cavern. It is natural, and massive stone pillars hold up the arched ceiling. In the forest of stalagmites, you can see more of your soldiers wandering mindlessly. Something down here is taking delight in stealing the minds of your people.";
	code =
		sf(this_town,3,1);
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0;
	text1 = "To the northeast, on the other side of a deep trench, you can see a skeleton. It stands still, scanning the cave with glowing red eyes. When its gaze washes over you, you feel dizzy. You have to run through a few mental focusing exercises to remain calm.";
	text2 = "Even from a distance, you can sense the power in those old, dry bones. This is the source of the curse on these mines.";
	code =
		sf(this_town,4,1);
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0;
	text1 = "__";
	code =
		sf(this_town,5,1);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0;
	text1 = "__";
	code =
		sf(this_town,6,1);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0;
	text1 = "__";
	code =
		sf(this_town,7,1);
	break;

begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "__";
	code =
		sf(this_town,8,1);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode;
	tag = 13;
	condition = 1;
	text1 = "You try to talk to the people here, but they are still consumed with terror. They can barely communicate. They manage to say that Captain Corthin speaks for them.";
	text2 = "Happily, they seem to be slowly recovering.";
	code =
		if (gf(47,11) == 0)
			rs(2);
	break;
	
begintalknode;
	tag = 14;
	condition = 1;
	text1 = "You give your target a heavy, decisive blow to the head, causing your warrior to stumble backwards, semi-conscious. Somehow, this causes the shade in control to lose its grip. As you watch in horror, the spirit slithers out of the soldier's dizzy head.";
	text2 = "As your warrior attempts to regain control and remain standing, the dark spirit hisses at you. It lunges forward, arms outstretched.";

begintalknode;
	tag = 15;
	condition = 1;
	text1 = "The angry Ro bones point at you. _You ... invader. I will know you. I will know your ways. I will know your weaknesses. Let me peek into your mind!_";
	text2 = "You instantly feel very dizzy.";
	code =
		set_dialogue_pic(853); // 
	break;	

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 17;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 18;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 19;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "__";

////

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "You approach the Captain of this outpost, the ranking warrior here. He sits at the table, staring at a sparse, uneaten meal. He is slumped over and quivering, a pathetic spectacle.";
	text2 = "He looks up at you, confused at first. Then his eyes focus and he realizes who you are. He unsteadily rises to his feet and salutes. _Welcome. I ... I am Captain Corthin. Of Spiral Mine. Of Haven. Um. Welcome._";
	text5 = "Captain Corthin sits, slumped over his meal. Occasionally, he mutters a few commands to his soldiers.";
	text6 = "Now that the curse has been lifted, the warriors are slowly emerging from their torpor. It will take some time for them to fully recover.";
	action = INTRO;
	code =
		if (gf(47,11) == 0)
			rs(6);
	break;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(47,12) == 0;
	question = "_I am [P] [N] of Haven. Report your situation._";
	text1 = "_Welcome, [P]._ He slumps back into his seat. _We are holding the claim, but ... We are afflicted. Curses. Spirits. It has been ... horrible. We need help._";
	code =
		sf(47,12,1);
	break;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(47,12) == 0;
	question = "_I'm going to need you to focus._";
	text1 = "_Oh. Yes. I am sorry, [P]._ He slumps back into his seat. _We will do our best. It has been difficult. We are holding the claim, but ... We are afflicted. Curses. Spirits. It has been ... horrible. We need help._";
	code =
		sf(47,12,1);
		queen_faction(1);
	break;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(47,12) == 0;
	question = "_There, there. It's OK._ Comfort him.";
	text1 = "You sit in the chair next to the captain, put your arm around his shoulders, and comfort him. He whimpers. Even the demoralized soldiers here are a little sickened by the display.";
	text1 = "_I am sorry, [P]. We are holding the claim, but ... We are afflicted. Curses. Spirits. It has been ... horrible. We need help._";
	code =
		sf(47,12,1);
		violence(-2);
		queen_faction(-2);
	break;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(47,12) == 0;
	question = "_Your behavior is shameful. Calm yourself or I will have you punished._";
	text1 = "He further slumps into his seat, but your sharp words have penetrated his brain._";
	text2 = "_I am sorry, [P]. I will try to improve. We are holding the claim, but ... We are afflicted. Curses. Spirits. It has been ... horrible. We need help._";
	code =
		sf(47,12,1);
		violence(2);
		queen_faction(2);
	break;
	
begintalknode;
	state = 10;
	nextstate = 11;
	condition = gf(47,12) > 0;
	question = "_Tell me about this mine._";
	text1 = "_It is a claim of Haven. We produce cinnabar ore. Then we extract the quicksilver elsewhere._";
	text2 = "_We are not useful now. We are defeated. I am sorry._";
	code =
		if (gf(47,11) > 0)
			rs(2);
	break;
	
begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_How did we obtain this mine?_";
	text1 = "_I ... I don't know. We've had it a long time. The High Lithans don't sell their land, so we probably did some heroic thing for them. Haven's soldiers are very heroic._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_Our forts require quicksilver._";
	text1 = "_I know._";
	text2 = "_I am sorry that we are letting you down._";
	text3 = "_The chief of [F5] can make sure you get it._";
	code =
		if (gf(47,11) > 0)
			rs(2);
			else rs(3);
	break;
	

begintalknode;
	state = 10;
	nextstate = 12;
	condition = gf(47,13) == 0 && gf(47,11) > 0;
	question = "_I have destroyed the horrors in the basement._";
	text1 = "You tell the story to your warriors and workers. With each word, they seem to regain some of their confidence and self-control. The Captain says, _We are grateful for your help, [P]. You should tell the Chief of [F5]. Then you can be sure to receive quicksilver quickly._";
	text2 = "_We will make sure that any possessed warriors are taken to [F5] for treatment. Were you able to save our claim without killing any of our warriors?_";
	code =
		sf(47,13,1);
	break;
	
begintalknode;
	state = 12;
	nextstate = -1;
	condition = gf(47,14) == 0;
	question = "_None of our warriors were killed._";
	text1 = "The Captain nods, impressed. _A heroic deed, [P]. Bravery, strength, and precision. The story will be sure to spread._";
	code =
		award_party_xp(100);
		ro_faction(2);
		queen_faction(2);
	break;
	
begintalknode;
	state = 12;
	nextstate = -1;
	condition = gf(47,14) > 0;
	question = "_Not all of our warriors survived._";
	text1 = "He shakes his head. _A dark time. A necessary sacrifice to help Haven control its wayward vassal. Still, a heroic deed._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(47,13) > 0 && gf(5,12) < 2;
	question = "_I still need more quicksilver._";
	text1 = "_Have you reported our new status to the Chief of [F5]? Chief Markov can get the supplies where they need to go._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(5,12) > 1;
	question = "_What is your status?_";
	text1 = "_Fully operational! Chief Markov is getting the supplies where they need to go._";
	
begintalknode;
	state = 10;
	nextstate = 13;
	condition = gf(47,12) > 0 && gf(47,13) == 0;
	question = "_Why is everyone so upset?_";
	text1 = "_Because ... We are lost. The claim is slipping away. The shades ... They come for us. They don't fight. We can't hurt them._";

begintalknode;
	state = 13;
	nextstate = 14;
	condition = 1;
	question = "_Where did these shades come from?_";
	text1 = "_Nowhere. Everywhere. They come out of walls. They float towards us. So fast. Then ... our warriors ... Lost._";

begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_Why are they attacking us?_";
	text1 = "_It is the Rokaj! Who knows why they do anything! The people here make no sense. They only tell the truth when they show how much they hate us._";

begintalknode;
	state = 14;
	nextstate = 15;
	condition = 1;
	question = "_What happened to our warriors?_";
	text1 = "_The shades ... slide into them. Take them over._ He starts to shudder uncontrollably. It takes a minute for him to regain his composure. _We can't fight back. We can't stop them. They just consume us._";
	text2 = "_We have done our best, but ... We only know one way to free them, and we don't have the strength to do it._";

begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_How did you free a taken warrior?_";
	text1 = "He points at one pale Havenite, slumped against the wall. He's covered with bandages and bruises. _When you batter a victim into unconsciousness, the shade loses its grip. It is hard, though. We almost killed Elred there getting him free._";
	text2 = "_You might be able to free our lost. However, it will take precision to do so without killing them._";

//

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = "The glowy skeleton points out at you across the trench. It opens its mouth, and a voice emerges, a chilling rasp that sends tendrils of terror crawling into your brain.";
	text2 = "_You have come. I see your insignia, [P]. I see in your mind. You are the one who crushes us. Now ... Now you will be mine._";
	code =
		set_dialogue_pic(853); // 
	break;	


begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_I am a [P] of Haven, and I demand that you withdraw._";
	text1 = "_No! You will withdraw! The time of freedom comes closer every day. My truth brought me from the grave to declare the time. At last, the Rokaj is awake. We will be free of you!_";
	text2 = "It mutters a few words of powerful magic. You can feel your identity start to slip away. At last, you see why the warriors upstairs were so terrified.";
	action = END_TALK;

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_Why have you come to torment us?_";
	text1 = "_We trade torment for torment! At last, the Rokaj rises up. Even our bones will walk to march against you. We are awake, and soon we will be free!_";
	text2 = "It mutters a few words of powerful magic. You can feel your identity start to slip away. At last, you see why the warriors upstairs were so terrified.";
	action = END_TALK;

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_If I bribe you, will you go away?_";
	text1 = "_We only want one thing, invader. Oppressor. We want our freedom. At last, the Rokaj rises up. Even our bones will walk to march against you. We are awake, and soon we will be free!_";
	text2 = "It mutters a few words of powerful magic. You can feel your identity start to slip away. At last, you see why the warriors upstairs were so terrified.";
	action = END_TALK;

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_Aaahh! A talking skeleton!_";
	text1 = "_Yes! Fear me! The Rokaj rejects you. Even our bones rise up to fight you! Now, you are lost!_";
	text2 = "It mutters a few words of powerful magic. You can feel your identity start to slip away. At last, you see why the warriors upstairs were so terrified.";
	action = END_TALK;


	
//

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "The skeleton collapses. The dark magic holding it together fades. The bones fly apart. Only the skull remains conscious, and only for a short time. It says, in a fading rasp, _I saw inside you. I saw the truth._";
	text2 = "_We are not special to you. We are only another clump of servants, to be controlled. Used._";
	code =
		set_dialogue_pic(853); // 
	break;	

begintalknode;
	state = 70;
	nextstate = 71;
	condition = 1;
	question = "_You are our vassal. You agreed to it, and that is what you will always be._";
	text1 = "_No. I am lost. Others will come. Soon, you will see. We will ..._";
	text2 = "Then the skull loses the last of its power. It is still.";

begintalknode;
	state = 70;
	nextstate = 71;
	condition = 1;
	question = "_Yes, you have been neglected. I have come to make amends._";
	text1 = "_It is ... too late. We are together. Resolute. Our leader will ..._";
	text2 = "Then the skull loses the last of its power. It is still.";
	code =
		violence(-2);
	break;
	
begintalknode;
	state = 70;
	nextstate = 71;
	condition = 1;
	question = "_You serve Haven. Any who oppose us will be destroyed, the way I have destroyed you._";
	text1 = "_Perhaps, but not without a fight. We are awake now. Our leader will ..._";
	text2 = "Then the skull loses the last of its power. It is still.";
	code =
		violence(2);
	break;

begintalknode;
	state = 70;
	nextstate = 71;
	condition = 1;
	question = "_Aaahhh! You're still talking!_ Keep attacking.";
	text1 = "You keep smashing the bones until they are scattered shards. Then you smash them until they are dust.";
	text2 = "The skull tries to say something else. You won't fall for that trick. You punt it into the trench. The creature is destroyed.";
	code =
		violence(1);
	break;

begintalknode;
	state = 71;
	nextstate = -1;
	condition = 1;
	question = "Look around.";
	text1 = "Instantly, the oppressive power hanging over these caves like a miasma lifts. It's damp and cold, but it's just a cave. The curse is lifted.";
	text2 = "This mine has been reclaimed. Now you only need to talk to the right person to claim your bounty of its quicksilver.";
	action = END_TALK;



//

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				